{"componentChunkName":"component---node-modules-rocketseat-gatsby-theme-docs-core-src-templates-docs-query-js","path":"/manual-review/ConfigHandlerFacet-CHF","result":{"data":{"mdx":{"id":"9f00320f-7e4d-54c3-90c4-491c5cb6c5cf","excerpt":"CHF-01M: Inexistent Validation of Proper Resolution Period Configuration Type Severity Location Input Sanitization ConfigHandlerFacet.sol:L427-L433 ,  L455-L46…","fields":{"slug":"/manual-review/ConfigHandlerFacet-CHF/"},"frontmatter":{"title":"ConfigHandlerFacet Manual Review Findings","description":"Contains all the findings that relate to manual review on the contract codebase","image":null,"disableTableOfContents":null},"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"ConfigHandlerFacet Manual Review Findings\",\n  \"description\": \"Contains all the findings that relate to manual review on the contract codebase\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h2\", {\n    \"id\": \"span-idchf-01mchf-01m-inexistent-validation-of-proper-resolution-period-configurationspan\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#span-idchf-01mchf-01m-inexistent-validation-of-proper-resolution-period-configurationspan\",\n    \"aria-label\": \"span idchf 01mchf 01m inexistent validation of proper resolution period configurationspan permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), mdx(\"span\", {\n    id: \"CHF-01M\"\n  }, \"CHF-01M: Inexistent Validation of Proper Resolution Period Configuration\")), mdx(\"table\", null, mdx(\"thead\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"thead\"\n  }, mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Type\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Severity\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Location\"))), mdx(\"tbody\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/reports/boson-protocol-version-2.3-64c3b2cf1570d80014096fc3/appendix/finding-types#input-sanitization\"\n  }, \"Input Sanitization\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"img\", {\n    parentName: \"td\",\n    \"className\": \"o-severity o-minor\",\n    \"src\": \"https://omniscia.io/report-assets/minor.png\"\n  })), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"https://github.com/bosonprotocol/boson-protocol-contracts/blob/02a4d2ff04832a4607674ba37708d4f52cdac4fa/contracts/protocol/facets/ConfigHandlerFacet.sol#L427-L433\"\n  }, \"ConfigHandlerFacet.sol:L427-L433\"), \", \", mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"https://github.com/bosonprotocol/boson-protocol-contracts/blob/02a4d2ff04832a4607674ba37708d4f52cdac4fa/contracts/protocol/facets/ConfigHandlerFacet.sol#L455-L461\"\n  }, \"L455-L461\"))))), mdx(\"h3\", {\n    \"id\": \"description\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#description\",\n    \"aria-label\": \"description permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Description:\"), mdx(\"p\", null, \"The \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/bosonprotocol/boson-protocol-contracts/blob/02a4d2ff04832a4607674ba37708d4f52cdac4fa/contracts/protocol/facets/ConfigHandlerFacet.sol#L427-L433\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"ConfigHandlerFacet::setMinResolutionPeriod\")), \" and \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/bosonprotocol/boson-protocol-contracts/blob/02a4d2ff04832a4607674ba37708d4f52cdac4fa/contracts/protocol/facets/ConfigHandlerFacet.sol#L455-L461\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"ConfigHandlerFacet::setMaxResolutionPeriod\")), \" functions do not properly sanitize their input arguments as conforming to their counterpart \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"maxResolutionPeriod\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"minResolutionPeriod\"), \" respectively.\"), mdx(\"h3\", {\n    \"id\": \"impact\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#impact\",\n    \"aria-label\": \"impact permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Impact:\"), mdx(\"p\", null, \"It is presently possible to misconfigure the resolution period range of the protocol limits which is an undesirable trait of the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"ConfigHandlerFacet\"), \" contract.\"), mdx(\"h3\", {\n    \"id\": \"example\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#example\",\n    \"aria-label\": \"example permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Example:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-sol\",\n    \"metastring\": \"title=contracts/protocol/facets/ConfigHandlerFacet.sol highlight={14,16,42,44} lineNumbers=true lineOffset=415\",\n    \"title\": \"contracts/protocol/facets/ConfigHandlerFacet.sol\",\n    \"highlight\": \"{14,16,42,44}\",\n    \"lineNumbers\": \"true\",\n    \"lineOffset\": \"415\"\n  }, \"/**\\n * @notice Sets the minimum resolution period a seller can specify.\\n *\\n * Emits a MinResolutionPeriodChanged event.\\n *\\n * Reverts if _minResolutionPeriod is zero.\\n *\\n * @dev Caller must have ADMIN role.\\n *\\n * @param _minResolutionPeriod - the minimum resolution period that a {BosonTypes.Seller} can specify\\n */\\nfunction setMinResolutionPeriod(uint256 _minResolutionPeriod) public override onlyRole(ADMIN) nonReentrant {\\n    // Make sure _maxResolutionPeriod is greater than 0\\n    checkNonZero(_minResolutionPeriod);\\n\\n    protocolLimits().minResolutionPeriod = _minResolutionPeriod;\\n    emit MinResolutionPeriodChanged(_minResolutionPeriod, msgSender());\\n}\\n\\n/**\\n * @notice Gets the minimum resolution period a seller can specify.\\n *\\n * @return the minimum resolution period that a {BosonTypes.Seller} can specify\\n */\\nfunction getMinResolutionPeriod() external view override returns (uint256) {\\n    return protocolLimits().minResolutionPeriod;\\n}\\n\\n/**\\n * @notice Sets the maximum resolution period a seller can specify.\\n *\\n * Emits a MaxResolutionPeriodChanged event if successful.\\n *\\n * Reverts if the _maxResolutionPeriod is zero.\\n *\\n * @dev Caller must have ADMIN role.\\n *\\n * @param _maxResolutionPeriod - the maximum resolution period that a {BosonTypes.Seller} can specify\\n */\\nfunction setMaxResolutionPeriod(uint256 _maxResolutionPeriod) public override onlyRole(ADMIN) nonReentrant {\\n    // Make sure _maxResolutionPeriod is greater than 0\\n    checkNonZero(_maxResolutionPeriod);\\n\\n    protocolLimits().maxResolutionPeriod = _maxResolutionPeriod;\\n    emit MaxResolutionPeriodChanged(_maxResolutionPeriod, msgSender());\\n}\\n\")), mdx(\"h3\", {\n    \"id\": \"recommendation\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#recommendation\",\n    \"aria-label\": \"recommendation permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Recommendation:\"), mdx(\"p\", null, \"We advise each function to ensure that the value is greater-than or less-than its counterpart, guaranteeing that the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"minResolutionPeriod\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"maxResolutionPeriod\"), \" values of \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"protocolLimits()\"), \" yield a correctly defined range of values.\"), mdx(\"h3\", {\n    \"id\": \"alleviation-2b9f60b6c3323fd234b570089ceff924cdb5851c\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#alleviation-2b9f60b6c3323fd234b570089ceff924cdb5851c\",\n    \"aria-label\": \"alleviation 2b9f60b6c3323fd234b570089ceff924cdb5851c permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Alleviation (2b9f60b6c3323fd234b570089ceff924cdb5851c):\"), mdx(\"p\", null, \"Both functions have been updated to ensure the minimum and maximum resolution period limitations define a valid range of values, alleviating this exhibit.\"), mdx(ViewDiffButton, {\n    repoUrl: \"https://github.com/bosonprotocol/boson-protocol-contracts\",\n    mainHash: \"02a4d2ff04832a4607674ba37708d4f52cdac4fa\",\n    fixHash: \"2b9f60b6c3323fd234b570089ceff924cdb5851c\",\n    gitHubIssue: \"722\",\n    mdxType: \"ViewDiffButton\"\n  }));\n}\n;\nMDXContent.isMDXComponent = true;","headings":[{"depth":2,"value":"<span id=\"CHF-01M\">CHF-01M: Inexistent Validation of Proper Resolution Period Configuration</span>"},{"depth":3,"value":"Description:"},{"depth":3,"value":"Impact:"},{"depth":3,"value":"Example:"},{"depth":3,"value":"Recommendation:"},{"depth":3,"value":"Alleviation (2b9f60b6c3323fd234b570089ceff924cdb5851c):"}]}},"pageContext":{"slug":"/manual-review/ConfigHandlerFacet-CHF/","prev":{"label":"BundleBase.sol (BBS-M)","link":"/manual-review/BundleBase-BBS"},"next":{"label":"ExchangeHandlerFacet.sol (EHF-M)","link":"/manual-review/ExchangeHandlerFacet-EHF"}}},"staticQueryHashes":["1954253342","2328931024","2501019404","973074209"]}